var pointAddress='';
var detailAddress='';
function getPoint(e) {    //点击地图获取一些信息，
    this.show = true;
    this.postionMap.lng = e.point.lng;     //通过  e.point.lng获取经度
    this.postionMap.lat = e.point.lat;     //通过  e.point.lat获取纬度
    this.add.jd = e.point.lng;
    this.add.wd = e.point.lat;
    this.zoom = e.target.getZoom()
    let geocoder = new BMap.Geocoder();  //创建地址解析器的实例
    geocoder.getLocation(e.point, rs => {
        this.add.site = rs.address;
        this.add.siteName=this.keyword;
        //地址描述
        //(string)=
        //console.log(rs.address);    //这里打印可以看到里面的详细地址信息，可以根据需求选择想要的
        //console.log(rs.addressComponents);//结构化的地址描述(object)
        //console.log(rs.addressComponents.province); //省
        //console.log(rs.addressComponents.city); //城市
        //console.log(rs.addressComponents.district); //区县
        //console.log(rs.addressComponents.street); //街道
        //console.log(rs.addressComponents.streetNumber); //门牌号
        //console.log(rs.surroundingPois); //附近的POI点(array)
        //console.log(rs.business); //商圈字段，代表此点所属的商圈(string)
        //console.log(rs.surroundingPois[0].point)
        //console.log(e.point)
        pointAddress = e.point.lng+","+e.point.lat;
        detailAddress=rs.address;
        //console.log(pointAddress);
        this.formData.coordinate=pointAddress;
        this.formData.address=detailAddress;
    });
}

function map(row) {
    /*let add = $("#add")[0];
    add.setAttribute("style", "display: block");*/
    this.keyword = row;
    //console.log(pointAddress);
    this.formData.coordinate=pointAddress;
    this.formData.address=detailAddress;

}

function infoWindowClose() {
    this.show = false
}
function infoWindowOpen() {
    //这里有个问题纠结了很久，百度的信息窗口默认有个点击其他地方就消失的事件，我没有找到
    //并且信息窗口点击一次显示，一次消失
    //于是我加了一个100毫秒的定时器，保证每次点击地图都可以展示信息窗口
    setInterval(() => {
        this.show = true
    }, 100)
}